Mercurial > pidgin.yaz
comparison src/protocols/bonjour/jabber.c @ 11823:27ed05facc71
[gaim-migrate @ 14114]
Allow a string to be localized and use gaim_debug_warning instead of
perror
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Tue, 25 Oct 2005 22:27:27 +0000 |
parents | b91a84e7cbcb |
children | e05778d4f12d |
comparison
equal
deleted
inserted
replaced
11822:cd20599f220b | 11823:27ed05facc71 |
---|---|
60 inet_aton(((BonjourBuddy*)(gb->proto_data))->ip, &(buddy_address.sin_addr)); | 60 inet_aton(((BonjourBuddy*)(gb->proto_data))->ip, &(buddy_address.sin_addr)); |
61 memset(&(buddy_address.sin_zero), '\0', 8); | 61 memset(&(buddy_address.sin_zero), '\0', 8); |
62 | 62 |
63 retorno = connect(socket_fd, (struct sockaddr*)&buddy_address, sizeof(struct sockaddr)); | 63 retorno = connect(socket_fd, (struct sockaddr*)&buddy_address, sizeof(struct sockaddr)); |
64 if (retorno == -1) { | 64 if (retorno == -1) { |
65 perror("connect"); | 65 gaim_debug_warning("bonjour", "connect error: %s\n", strerror(errno)); |
66 } | 66 } |
67 fcntl(socket_fd, F_SETFL, O_NONBLOCK); | 67 fcntl(socket_fd, F_SETFL, O_NONBLOCK); |
68 | 68 |
69 return socket_fd; | 69 return socket_fd; |
70 } | 70 } |
264 total_message_length += parcial_message_length; | 264 total_message_length += parcial_message_length; |
265 } | 265 } |
266 | 266 |
267 if (parcial_message_length == -1) | 267 if (parcial_message_length == -1) |
268 { | 268 { |
269 perror("recv"); | 269 gaim_debug_warning("bonjour", "receive error: %s\n", strerror(errno)); |
270 if (total_message_length == 0) { | 270 if (total_message_length == 0) { |
271 return -1; | 271 return -1; |
272 } | 272 } |
273 } | 273 } |
274 | 274 |
566 { | 566 { |
567 // Start the stream | 567 // Start the stream |
568 if (send(bb->conversation->socket, DOCTYPE, strlen(DOCTYPE), 0) == -1) | 568 if (send(bb->conversation->socket, DOCTYPE, strlen(DOCTYPE), 0) == -1) |
569 { | 569 { |
570 gaim_debug_error("bonjour", "Unable to start a conversation\n"); | 570 gaim_debug_error("bonjour", "Unable to start a conversation\n"); |
571 perror("send"); | 571 gaim_debug_warning("bonjour", "send error: %s\n", strerror(errno)); |
572 conv_message = g_strdup("Unable to send the message, the conversation couldn't be started."); | 572 conv_message = g_strdup("Unable to send the message, the conversation couldn't be started."); |
573 conversation = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, bb->name, data->account); | 573 conversation = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, bb->name, data->account); |
574 gaim_conversation_write(conversation, NULL, conv_message, GAIM_MESSAGE_SYSTEM, time(NULL)); | 574 gaim_conversation_write(conversation, NULL, conv_message, GAIM_MESSAGE_SYSTEM, time(NULL)); |
575 close(bb->conversation->socket); | 575 close(bb->conversation->socket); |
576 gaim_input_remove(bb->conversation->watcher_id); | 576 gaim_input_remove(bb->conversation->watcher_id); |