[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Freehoo-devel] file transfers - help needed
From: |
Anand Avati |
Subject: |
[Freehoo-devel] file transfers - help needed |
Date: |
Wed, 16 Feb 2005 12:20:29 +0530 |
User-agent: |
Mutt/1.4.2.1i |
hello group,
some guidance please.. regarding file transfers using libyahoo2.. i am
trying to fix the broken file transfer features of freehoo
i call yahoo_send_file() with the correct arguments including a proper
callback function.. the callback gets called with a valid FD to
filetransfer server of yahoo.. and i can write() my file contents into
it also.. but the file does'nt reach the destination buddy..
Am i supposed to do something else which I'm missing?
i compared the tcpdump -X outputs using libyahoo2 client and gaim..
with gaim i get the following..
1. syn/ack handshake with fileserver port 80
2. HTTP POST to /notifyft with cookie
3. YMSG packet mentioning destbuddy/me/message/filename/size
4. contents of the file
with the libyahoo2 client i get
1. syn/ack handshake
2. HTTP POST TO /notifyft with cookie
3. <missing!>
4. contents of the file
i had a look at the source code of 0.7.5 and here's what i figured out..
a. yahoo_send_file() creates the packet needed for step 3 mentioned above.
b. it calls yahoo_http_post with _yahoo_send_file_connected() as callback
function, and a structure having step3's pkt and freehoo
provided callback/data as callback data for _yahoo_send_file_connected.
c. _yahoo_send_file_connected gets called with an fd connected to
fileserver port 80.
d. _yahoo_send_file_connected calls yahoo_send_packet() with step3's pkt as
arg
e. _yahoo_send_file_connected then calls freehoo provided callback
function which writes file contents into the fd (socket to fileserver
port 80)
now the issue is that within step d, yahoo_send_packet() serialises
yahoo_packet into a byte stream, and calls yahoo_add_to_send_queue with
the byte stream as the TX buffer.. which in turn just queue's the buffer
to yid->txqueue and returns ... (note, still not written into socket)
then it calls freehoo provided callback, where i just write() file contents
into the fd.. (still the step3's pkt not written)..
to verify that, i changed in yahoo_send_packet,
s/yahoo_add_to_send_queue/yahoo_send_data/ and i COULD succesfully TX my file..
now what i feel is i am missing some 'ritual' .. and instead of write()'ing my
file contents to the newly got FD i should somehow make it get
yahoo_add_to_send_queue()'d behind step3's pkt .. am i right? i'm not able to
figure out how to do that.. kindly show me the right way to get going..
thanks and regards,
avati
--
We will have solar energy as soon as the utility companies solve one
technical problem -- how to run a sunbeam through a meter.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freehoo-devel] file transfers - help needed,
Anand Avati <=