Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#1001 closed defect (fixed)

Calling pj_sock_getsockname() on a newly accepted socket may fail if IOCP ioqueue backend is used (thanks Christian Gan for for report)

Reported by: bennylp Owned by: bennylp
Priority: normal Milestone: release-1.5.5
Component: pjlib Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported:

Description

The pj_sock_getsockname() call fails probably because SO_UPDATE_ACCEPT_CONTEXT socket option had not been set yet after the socket is accepted. Note that it has been called in pj_sock_accept(), although this call may not do anything useful since the socket is not accepted yet.

Attachments (1)

diff.txt (3.2 KB) - added by ming 14 years ago.
http://codereview.teluu.com/264193/show

Download all attachments as: .zip

Change History (4)

comment:1 Changed 14 years ago by nanang

In r3051:

  • Moved setsockopt(SO_UPDATE_ACCEPT_CONTEXT) from pj_sock_accept() to ioqueue_on_accept_complete().
  • Added setsockopt(SO_UPDATE_ACCEPT_CONTEXT) in pj_sock_accept() for new accepted socket when immediate connection is available.
  • Added pj_sock_getsockname() check in unit test ioq_tcp.c for new accepted socket.

comment:2 Changed 14 years ago by nanang

  • Resolution set to fixed
  • Status changed from new to closed

comment:3 Changed 14 years ago by ismangil

  • Milestone changed from release-1.6 to release-1.5.5
Note: See TracTickets for help on using tickets.