- Timestamp:
- Aug 26, 2008 2:41:26 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/ioqueue_winnt.c
r2155 r2240 176 176 177 177 /* Operation complete immediately. */ 178 GetAcceptExSockaddrs( accept_overlapped->accept_buf, 179 0, 180 ACCEPT_ADDR_LEN, 181 ACCEPT_ADDR_LEN, 182 &local, 183 &locallen, 184 &remote, 185 &remotelen); 186 if (*accept_overlapped->addrlen >= locallen) { 187 pj_memcpy(accept_overlapped->local, local, locallen); 188 pj_memcpy(accept_overlapped->remote, remote, locallen); 189 } else { 190 pj_bzero(accept_overlapped->local, *accept_overlapped->addrlen); 191 pj_bzero(accept_overlapped->remote, *accept_overlapped->addrlen); 192 } 193 *accept_overlapped->addrlen = locallen; 178 if (accept_overlapped->addrlen) { 179 GetAcceptExSockaddrs( accept_overlapped->accept_buf, 180 0, 181 ACCEPT_ADDR_LEN, 182 ACCEPT_ADDR_LEN, 183 &local, 184 &locallen, 185 &remote, 186 &remotelen); 187 if (*accept_overlapped->addrlen >= locallen) { 188 if (accept_overlapped->local) 189 pj_memcpy(accept_overlapped->local, local, locallen); 190 if (accept_overlapped->remote) 191 pj_memcpy(accept_overlapped->remote, remote, locallen); 192 } else { 193 if (accept_overlapped->local) 194 pj_bzero(accept_overlapped->local, 195 *accept_overlapped->addrlen); 196 if (accept_overlapped->remote) 197 pj_bzero(accept_overlapped->remote, 198 *accept_overlapped->addrlen); 199 } 200 201 *accept_overlapped->addrlen = locallen; 202 } 194 203 if (accept_overlapped->newsock_ptr) 195 204 *accept_overlapped->newsock_ptr = accept_overlapped->newsock; … … 701 710 ioqueue_accept_rec *accept_rec = (ioqueue_accept_rec*)pOv; 702 711 pj_status_t status = PJ_SUCCESS; 703 704 if (accept_rec->newsock == PJ_INVALID_SOCKET) { 712 pj_sock_t newsock; 713 714 newsock = accept_rec->newsock; 715 accept_rec->newsock = PJ_INVALID_SOCKET; 716 717 if (newsock == PJ_INVALID_SOCKET) { 705 718 int dwError = WSAGetLastError(); 706 719 if (dwError == 0) dwError = OSERR_ENOTCONN; … … 708 721 } 709 722 710 key->cb.on_accept_complete(key, 711 (pj_ioqueue_op_key_t*)pOv, 712 accept_rec->newsock, 713 status); 714 accept_rec->newsock = PJ_INVALID_SOCKET; 723 key->cb.on_accept_complete(key, (pj_ioqueue_op_key_t*)pOv, 724 newsock, status); 725 715 726 } 716 727 break;
Note: See TracChangeset
for help on using the changeset viewer.