~ubuntu-branches/ubuntu/trusty/mod-gearman/trusty

« back to all changes in this revision

Viewing changes to common/gearman.c

  • Committer: Bazaar Package Importer
  • Author(s): Stig Sandbeck Mathisen
  • Date: 2011-09-22 21:25:15 UTC
  • mfrom: (4.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110922212515-w9amj0jz6vt9l36i
Tags: 1.0.10-1
* New upstream release
* Use upstream tarball instead of git repo

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
        x++;
113
113
    }
114
114
 
 
115
    current_client_dup = client;
 
116
 
115
117
    return GM_OK;
116
118
}
117
119
 
150
152
    }
151
153
    assert(x != 0);
152
154
 
 
155
 
 
156
    current_client = client;
 
157
 
153
158
    return GM_OK;
154
159
}
155
160
 
159
164
    gearman_task_st *task = NULL;
160
165
    gearman_return_t ret1, ret2;
161
166
    char * crypted_data;
162
 
    int size;
 
167
    int size, free_uniq;
163
168
    struct timeval now;
164
169
 
 
170
    /* check too long queue names */
 
171
    if(strlen(queue) > 63) {
 
172
        gm_log( GM_LOG_ERROR, "queue name too long: '%s'\n", queue );
 
173
        return GM_ERROR;
 
174
    }
 
175
 
 
176
    /* cut off to long uniq ids */
 
177
    free_uniq = 0;
 
178
    if(uniq != NULL && strlen(uniq) > 63) {
 
179
        uniq = strndup(uniq, 63);
 
180
        free_uniq = 1;
 
181
    }
 
182
 
165
183
    signal(SIGPIPE, SIG_IGN);
166
184
 
167
185
    gm_log( GM_LOG_TRACE, "add_job_to_queue(%s, %s, %d, %d, %d, %d)\n", queue, uniq, priority, retries, transport_mode, send_now );
248
266
    /* reset error counter */
249
267
    mod_gm_con_errors = 0;
250
268
 
 
269
    if(free_uniq)
 
270
        free(uniq);
 
271
 
251
272
    gm_log( GM_LOG_TRACE, "add_job_to_queue() finished sucessfully: %d %d\n", ret1, ret2 );
252
273
    return GM_OK;
253
274
}