comparison src/protocols/yahoo/yahoo.c @ 3720:34c95669952f

[gaim-migrate @ 3853] WIN32 ifdef removals committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Wed, 16 Oct 2002 21:14:51 +0000
parents 5e50f6746509
children f53370197bb9
comparison
equal deleted inserted replaced
3719:5233e2276a72 3720:34c95669952f
363 pos += yahoo_put32(data + pos, pkt->id); 363 pos += yahoo_put32(data + pos, pkt->id);
364 364
365 yahoo_packet_write(pkt, data + pos); 365 yahoo_packet_write(pkt, data + pos);
366 366
367 yahoo_packet_dump(data, len); 367 yahoo_packet_dump(data, len);
368 #ifndef _WIN32
369 ret = write(yd->fd, data, len); 368 ret = write(yd->fd, data, len);
370 #else
371 ret = send(yd->fd, data, len, 0);
372 #endif
373 g_free(data); 369 g_free(data);
374 370
375 return ret; 371 return ret;
376 } 372 }
377 373
892 struct gaim_connection *gc = data; 888 struct gaim_connection *gc = data;
893 struct yahoo_data *yd = gc->proto_data; 889 struct yahoo_data *yd = gc->proto_data;
894 char buf[1024]; 890 char buf[1024];
895 int len; 891 int len;
896 892
897 #ifndef _WIN32
898 len = read(yd->fd, buf, sizeof(buf)); 893 len = read(yd->fd, buf, sizeof(buf));
899 #else
900 len = recv(yd->fd, buf, sizeof(buf), 0);
901 #endif
902 894
903 if (len <= 0) { 895 if (len <= 0) {
904 #ifdef _WIN32
905 if(len == SOCKET_ERROR)
906 debug_printf("Error reading socket: %d\n", WSAGetLastError());
907 else if( len == 0 )
908 debug_printf("Connection was gracefully closed.\n");
909 #endif
910 hide_login_progress_error(gc, "Unable to read"); 896 hide_login_progress_error(gc, "Unable to read");
911 signoff(gc); 897 signoff(gc);
912 return; 898 return;
913 } 899 }
914 900
966 struct gaim_connection *gc = data; 952 struct gaim_connection *gc = data;
967 struct yahoo_data *yd; 953 struct yahoo_data *yd;
968 struct yahoo_packet *pkt; 954 struct yahoo_packet *pkt;
969 955
970 if (!g_slist_find(connections, gc)) { 956 if (!g_slist_find(connections, gc)) {
971 #ifndef _WIN32
972 close(source); 957 close(source);
973 #else
974 closesocket(source);
975 #endif
976 return; 958 return;
977 } 959 }
978 960
979 if (source < 0) { 961 if (source < 0) {
980 hide_login_progress(gc, "Unable to connect"); 962 hide_login_progress(gc, "Unable to connect");
1038 g_hash_table_foreach_remove(yd->hash, yahoo_destroy_hash, NULL); 1020 g_hash_table_foreach_remove(yd->hash, yahoo_destroy_hash, NULL);
1039 g_hash_table_destroy(yd->hash); 1021 g_hash_table_destroy(yd->hash);
1040 g_hash_table_foreach_remove(yd->games, yahoo_destroy_hash, NULL); 1022 g_hash_table_foreach_remove(yd->games, yahoo_destroy_hash, NULL);
1041 g_hash_table_destroy(yd->games); 1023 g_hash_table_destroy(yd->games);
1042 if (yd->fd >= 0) 1024 if (yd->fd >= 0)
1043 #ifndef _WIN32
1044 close(yd->fd); 1025 close(yd->fd);
1045 #else 1026
1046 closesocket(yd->fd);
1047 #endif
1048 if (yd->rxqueue) 1027 if (yd->rxqueue)
1049 g_free(yd->rxqueue); 1028 g_free(yd->rxqueue);
1050 yd->rxlen = 0; 1029 yd->rxlen = 0;
1051 if (gc->inpa) 1030 if (gc->inpa)
1052 gaim_input_remove(gc->inpa); 1031 gaim_input_remove(gc->inpa);