~registry/scalestack/trunk

« back to all changes in this revision

Viewing changes to scalestack/database_proxy/connection.cc

  • Committer: Eric Day
  • Date: 2010-12-04 17:17:34 UTC
  • mfrom: (56.1.9)
  • Revision ID: git-v1:9c392b034d652023a4b28ae2976aca128bb856c2
Merged Eric's branch with style updates, config file support, and other cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
#include <cstring>
19
19
 
 
20
#include <scalestack/database_proxy/service.h>
20
21
#include <scalestack/database_proxy/client.h>
21
22
#include <scalestack/database_proxy/connection.h>
22
 
#include <scalestack/database_proxy/service.h>
23
23
#include <scalestack/kernel/module.h>
24
24
 
25
25
namespace scalestack
76
76
  {
77
77
    if (_client == NULL)
78
78
    {
79
 
      static_cast<service&>(_service).remove_from_queue(this);
 
79
      static_cast<service&>(_stream_service).remove_from_queue(this);
80
80
      remove();
81
81
      return;
82
82
    }
83
83
 
84
 
    static_cast<service&>(_service).yield_client(_client);
 
84
    static_cast<service&>(_stream_service).yield_client(_client);
85
85
    _client = NULL;
86
86
    return;
87
87
  }
88
88
 
89
89
  if (_client == NULL)
90
 
    _client = static_cast<service&>(_service).get_client(this, _need_handshake);
 
90
    _client = static_cast<service&>(_stream_service).get_client(this, _need_handshake);
91
91
  else if (_need_yield)
92
92
  {
93
93
    _need_yield = false;
94
 
    static_cast<service&>(_service).yield_client(_client);
 
94
    static_cast<service&>(_stream_service).yield_client(_client);
95
95
    _client = NULL;
96
96
  }
97
97
}
114
114
  if (_need_yield)
115
115
  {
116
116
    _need_yield = false;
117
 
    static_cast<service&>(_service).yield_client(_client);
 
117
    static_cast<service&>(_stream_service).yield_client(_client);
118
118
    _client = NULL;
119
119
  }
120
120
 
121
121
  if (_client == NULL)
122
122
  {
123
 
    _client = static_cast<service&>(_service).get_client(this, _need_handshake);
 
123
    _client = static_cast<service&>(_stream_service).get_client(this, _need_handshake);
124
124
    /* Just return here, the client will call this when ready. */
125
125
    return 0;
126
126
  }