~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_gearman/logging_gearman.cc

  • Committer: Lee Bieber
  • Date: 2010-11-14 23:15:42 UTC
  • mfrom: (1929.1.42 warning-stack-frame)
  • Revision ID: kalebral@gmail.com-20101114231542-fnnu6ydd2p17n582
Merge Monty - fix bug 672372: some functions use > 32k stack

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 */
19
19
 
20
20
#include "config.h"
 
21
 
 
22
#include <boost/scoped_array.hpp>
 
23
 
21
24
#include <drizzled/plugin/logging.h>
22
25
#include <drizzled/gettext.h>
23
26
#include <drizzled/session.h>
31
34
#include <fcntl.h>
32
35
#include <cstdio>
33
36
#include <cerrno>
 
37
#include <memory>
34
38
 
35
39
using namespace drizzled;
36
40
namespace po= boost::program_options;
226
230
 
227
231
  virtual bool post(Session *session)
228
232
  {
229
 
    char msgbuf[MAX_MSG_LEN];
 
233
    boost::scoped_array<char> msgbuf(new char[MAX_MSG_LEN]);
230
234
    int msgbuf_len= 0;
231
235
  
232
236
    assert(session != NULL);
251
255
    const char *dbs= session->db.empty() ? "" : session->db.c_str();
252
256
  
253
257
    msgbuf_len=
254
 
      snprintf(msgbuf, MAX_MSG_LEN,
 
258
      snprintf(msgbuf.get(), MAX_MSG_LEN,
255
259
               "%"PRIu64",%"PRIu64",%"PRIu64",\"%.*s\",\"%s\",\"%.*s\","
256
260
               "%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64","
257
261
               "%"PRIu32",%"PRIu32",%"PRIu32",\"%s\"",
284
288
    (void) gearman_client_do_background(&gearman_client,
285
289
                                        sysvar_logging_gearman_function,
286
290
                                        NULL,
287
 
                                        (void *) msgbuf,
 
291
                                        (void *) msgbuf.get(),
288
292
                                        (size_t) msgbuf_len,
289
293
                                        job_handle);
290
294