comparison src/oscar.c @ 1188:004d472be8a3

[gaim-migrate @ 1198] seeing as how i accidentally committed an aim_ft.c that i never meant to i might as well commit this too. don't accept a getfile request from someone when you're using oscar. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 02 Dec 2000 19:03:21 +0000
parents c00fc3adfd66
children 90bb83cafb9e
comparison
equal deleted inserted replaced
1187:6a8e8c06baa5 1188:004d472be8a3
883 gtk_widget_show(gt->window); 883 gtk_widget_show(gt->window);
884 884
885 return 1; 885 return 1;
886 } 886 }
887 887
888 /*
889 static void getfile_send_callback(gpointer data, gint source, GdkInputCondition condition) { 888 static void getfile_send_callback(gpointer data, gint source, GdkInputCondition condition) {
890 struct getfile_transfer *gt = (struct getfile_transfer *)data; 889 struct getfile_transfer *gt = (struct getfile_transfer *)data;
891 char buf[1024]; 890 char buf[1024];
892 891 int result;
893 debug_printf("getfile_send_callback for file %s to %s\n", gt->filename, gt->receiver); 892
894 gt->pos += aim_getfile_send_chunk(gt->conn, gt->file, gt->fh, gt->pos, 1024); 893 result = aim_getfile_send_chunk(gt->conn, gt->file, gt->fh, -1, 1024);
895 } 894 gt->pos += result;
896 */ 895 if (result == 0) {
896 gdk_input_remove(gt->gop); gt->gop = 0;
897 } else if (result == -1) {
898 do_error_dialog(_("Error in transfer"), "Gaim");
899 gdk_input_remove(gt->gop); gt->gop = 0;
900 interrupt_getfile(NULL, gt);
901 }
902 }
897 903
898 static int gaim_getfile_filesend(struct aim_session_t *sess, struct command_rx_struct *command, ...) { 904 static int gaim_getfile_filesend(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
899 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); 905 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess);
900 struct oscar_data *od = (struct oscar_data *)gc->proto_data; 906 struct oscar_data *od = (struct oscar_data *)gc->proto_data;
901 struct getfile_transfer *gt; 907 struct getfile_transfer *gt;
908 int result;
902 909
903 va_list ap; 910 va_list ap;
904 struct aim_conn_t *oftconn; 911 struct aim_conn_t *oftconn;
905 struct aim_fileheader_t *fh; 912 struct aim_fileheader_t *fh;
906 char *path, *cookie; 913 char *path, *cookie;
921 if ((gt->file = fopen(gt->filename, "r")) == NULL) { 928 if ((gt->file = fopen(gt->filename, "r")) == NULL) {
922 interrupt_getfile(NULL, gt); 929 interrupt_getfile(NULL, gt);
923 return 1; 930 return 1;
924 } 931 }
925 gt->pos = 0; 932 gt->pos = 0;
926 gt->fh = fh; 933 gt->fh = g_memdup(fh, sizeof(struct aim_fileheader_t));
927 934 fseek(gt->file, 0, SEEK_SET);
928 /* gt->gop = gdk_input_add(gt->conn->fd, GDK_INPUT_WRITE, getfile_send_callback, gt); */ 935
929 /* yes, this is bad. but i don't think aim_getfile_send_chunk works. */ 936 gt->gop = gdk_input_add(gt->conn->fd, GDK_INPUT_WRITE, getfile_send_callback, gt);
930 aim_getfile_send(oftconn, gt->file, fh);
931 937
932 return 1; 938 return 1;
933 } 939 }
934 940
935 static int gaim_getfile_complete(struct aim_session_t *sess, struct command_rx_struct *command, ...) { 941 static int gaim_getfile_complete(struct aim_session_t *sess, struct command_rx_struct *command, ...) {