Write queue after connect windows

On 09/25/2014 06:45 PM, Trevor Norris wrote:
> In src/win/pipe.c:
> 
>> @@ -1742,6 +1779,11 @@ void uv_process_pipe_connect_req(uv_loop_t* loop, uv_pipe_t* handle,
>>      req->cb(req, uv_translate_sys_error(err));
>>    }
>>  
>> +  if (!err)
>> +    uv__write_callbacks((uv_stream_t*) handle);
>> +  else
>> +    uv__stream_flush_write_queue((uv_stream_t*) handle, UV_ECANCELED);
> 
> @txdv <https://github.com/txdv>
> 
>     We issued the connection request first and now you want to execute
>     the writes before the connection request?
> 
> What I understood from @piscisaureus <https://github.com/piscisaureus>
> was that he believed the writes should occur just before the
> |uv_connect_cb| runs (hopefully he wouldn't mind jumping in and giving
> some feedback ;-).
> 
> @saghul <https://github.com/saghul>
> 
>     I'd say writes always come *after*connect.
> 
> Do you mean /after/ the |uv_connect_cb| has run, or just after the
> connection has been made?
> 

I mean just after the connection callback was called. Unix does it this
way, and it doesn't make much sense to make it the other way around
IMHO, since it's not possible to write anything before being connected,
so getting the status of those operations in the same order is expected.