Changeset 074c9b6


Ignore:
Timestamp:
2015-05-31T02:40:04Z (5 years ago)
Author:
dequis <dx@…>
Children:
d2411a1
Parents:
767b2d1
git-author:
dequis <dx@…> (10-04-15 11:33:58)
git-committer:
dequis <dx@…> (31-05-15 02:40:04)
Message:

msn: remove fd parameter from msn_ns_write

Location:
protocols/msn
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/msn.c

    r767b2d1 r074c9b6  
    193193                "/user", "application/user+xml",
    194194                strlen(body), body);
    195         msn_ns_write(ic, -1, "PUT %d %zd\r\n%s", ++md->trId, strlen(buf), buf);
     195        msn_ns_write(ic, "PUT %d %zd\r\n%s", ++md->trId, strlen(buf), buf);
    196196
    197197        g_free(buf);
     
    244244static void msn_keepalive(struct im_connection *ic)
    245245{
    246         msn_ns_write(ic, -1, "PNG\r\n");
     246        msn_ns_write(ic, "PNG\r\n");
    247247}
    248248
  • protocols/msn/msn.h

    r767b2d1 r074c9b6  
    217217
    218218/* ns.c */
    219 int msn_ns_write(struct im_connection *ic, int fd, const char *fmt, ...) G_GNUC_PRINTF(3, 4);
     219int msn_ns_write(struct im_connection *ic, const char *fmt, ...) G_GNUC_PRINTF(2, 3);
    220220gboolean msn_ns_connect(struct im_connection *ic, const char *host, int port);
    221221void msn_ns_close(struct msn_data *handler);
  • protocols/msn/msn_util.c

    r767b2d1 r074c9b6  
    7171
    7272        if ((adl = adlrml_entry(who, list))) {
    73                 int st = msn_ns_write(ic, -1, "ADL %d %zd\r\n%s",
     73                int st = msn_ns_write(ic, "ADL %d %zd\r\n%s",
    7474                                      ++md->trId, strlen(adl), adl);
    7575                g_free(adl);
     
    105105
    106106        if ((adl = adlrml_entry(who, list))) {
    107                 int st = msn_ns_write(ic, -1, "RML %d %zd\r\n%s",
     107                int st = msn_ns_write(ic, "RML %d %zd\r\n%s",
    108108                                      ++md->trId, strlen(adl), adl);
    109109                g_free(adl);
  • protocols/msn/ns.c

    r767b2d1 r074c9b6  
    4343static void msn_ns_nfy(struct msn_data *md, char *who, char **parts, char *action, gboolean is_put);
    4444
    45 int msn_ns_write(struct im_connection *ic, int fd, const char *fmt, ...)
     45int msn_ns_write(struct im_connection *ic, const char *fmt, ...)
    4646{
    4747        struct msn_data *md = ic->proto_data;
     
    5555        va_end(params);
    5656
    57         if (fd < 0) {
    58                 fd = md->fd;
    59         }
    60 
    6157        if (getenv("BITLBEE_DEBUG")) {
    62                 fprintf(stderr, "\x1b[91m>>>[NS%d] %s\n\x1b[97m", fd, out);
     58                fprintf(stderr, "\x1b[91m>>>[NS] %s\n\x1b[97m", out);
    6359        }
    6460
     
    138134        }
    139135
    140         if (msn_ns_write(ic, -1, "VER %d %s CVR0\r\n", ++md->trId, MSNP_VER)) {
     136        if (msn_ns_write(ic, "VER %d %s CVR0\r\n", ++md->trId, MSNP_VER)) {
    141137                if (!md->is_http) {
    142138                        md->inpa = b_input_add(md->fd, B_EV_IO_READ, msn_ns_callback, md);
     
    218214                }
    219215
    220                 return(msn_ns_write(ic, md->fd, "CVR %d 0x0409 mac 10.2.0 ppc macmsgs 3.5.1 macmsgs %s VmVyc2lvbjogMQ0KWGZyQ291bnQ6IDINClhmclNlbnRVVENUaW1lOiA2MzU2MTQ3OTU5NzgzOTAwMDANCklzR2VvWGZyOiB0cnVlDQo=\r\n",
     216                return(msn_ns_write(ic, "CVR %d 0x0409 mac 10.2.0 ppc macmsgs 3.5.1 macmsgs %s VmVyc2lvbjogMQ0KWGZyQ291bnQ6IDINClhmclNlbnRVVENUaW1lOiA2MzU2MTQ3OTU5NzgzOTAwMDANCklzR2VvWGZyOiB0cnVlDQo=\r\n",
    221217                                    ++md->trId, ic->acc->user));
    222218        } else if (strcmp(cmd[0], "CVR") == 0) {
    223219                /* We don't give a damn about the information we just received */
    224                 return msn_ns_write(ic, md->fd, "USR %d SSO I %s\r\n", ++md->trId, ic->acc->user);
     220                return msn_ns_write(ic, "USR %d SSO I %s\r\n", ++md->trId, ic->acc->user);
    225221        } else if (strcmp(cmd[0], "XFR") == 0) {
    226222                char *server;
     
    302298                resp = msn_p11_challenge(cmd[2]);
    303299
    304                 st =  msn_ns_write(ic, -1, "QRY %d %s %zd\r\n%s",
     300                st =  msn_ns_write(ic, "QRY %d %s %zd\r\n%s",
    305301                                   ++md->trId, MSNP11_PROD_ID,
    306302                                   strlen(resp), resp);
     
    602598
    603599        if (token) {
    604                 msn_ns_write(ic, -1, "USR %d SSO S %s %s {%s}\r\n", ++md->trId, md->tokens[0], token, md->uuid);
     600                msn_ns_write(ic, "USR %d SSO S %s %s {%s}\r\n", ++md->trId, md->tokens[0], token, md->uuid);
    605601        } else {
    606602                imcb_error(ic, "Error during Passport authentication: %s", error);
     
    681677        adls = xt_to_string(adl);
    682678        xt_free_node(adl);
    683         msn_ns_write(ic, -1, "ADL %d %zd\r\n%s", ++md->trId, strlen(adls), adls);
     679        msn_ns_write(ic, "ADL %d %zd\r\n%s", ++md->trId, strlen(adls), adls);
    684680        g_free(adls);
    685681}
     
    738734
    739735        buf = g_strdup_printf(MSN_MESSAGE_HEADERS, bu->handle, ic->acc->user, md->uuid, message_type, strlen(text), text);
    740         retval = msn_ns_write(ic, -1, "SDG %d %zd\r\n%s", ++md->trId, strlen(buf), buf);
     736        retval = msn_ns_write(ic, "SDG %d %zd\r\n%s", ++md->trId, strlen(buf), buf);
    741737        g_free(buf);
    742738        return retval;
Note: See TracChangeset for help on using the changeset viewer.