Changeset 1440 for pyamf/trunk/pyamf/remoting/client/__init__.py
- Timestamp:
- 06/20/08 10:38:08 (7 months ago)
- Files:
-
- 1 modified
-
pyamf/trunk/pyamf/remoting/client/__init__.py (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pyamf/trunk/pyamf/remoting/client/__init__.py
r1427 r1440 45 45 Inform the proxied service that this function has been called. 46 46 """ 47 47 48 return self.service._call(self, *args) 48 49 … … 231 232 raise ValueError, 'Unknown scheme' 232 233 233 self.logger. debug('creating connection to %s://%s:%s' % (self.url[0], hostname, port))234 self.logger.info('Creating connection to %s://%s:%s' % (self.url[0], hostname, port)) 234 235 235 236 def addHeader(self, name, value, must_understand=False): … … 274 275 self.request_number += 1 275 276 self.requests.append(wrapper) 276 self.logger.debug(' adding request %s%r' % (wrapper.service, args))277 self.logger.debug('Adding request %s%r' % (wrapper.service, args)) 277 278 278 279 return wrapper … … 285 286 """ 286 287 if isinstance(service, RequestWrapper): 288 self.logger.debug('Removing request: %s' % (self.requests[self.requests.index(service)])) 287 289 del self.requests[self.requests.index(service)] 288 290 … … 291 293 for request in self.requests: 292 294 if request.service == service and request.args == args: 295 self.logger.debug('Removing request: %s' % (self.requests[self.requests.index(request)])) 293 296 del self.requests[self.requests.index(request)] 294 297 … … 307 310 """ 308 311 envelope = remoting.Envelope(self.amf_version, self.client_type) 309 312 313 self.logger.debug('AMF version: %s' % self.amf_version) 314 self.logger.debug('Client type: %s' % self.client_type) 315 310 316 for request in requests: 311 317 service = request.service … … 327 333 @rtype: 328 334 """ 329 self.logger.debug(' executing single request')335 self.logger.debug('Executing single request: %s' % request) 330 336 body = remoting.encode(self.getAMFRequest([request])) 331 337 332 self.logger.debug(' sending POST request to %s' % self._root_url)338 self.logger.debug('Sending POST request to %s' % self._root_url) 333 339 self.connection.request('POST', self._root_url, body.getvalue(), 334 340 {'Content-Type': remoting.CONTENT_TYPE}) … … 346 352 body = remoting.encode(self.getAMFRequest(self.requests)) 347 353 354 self.logger.debug('Sending POST request to %s' % self._root_url) 348 355 self.connection.request('POST', self._root_url, body.getvalue(), 349 356 {'Content-Type': remoting.CONTENT_TYPE}) … … 363 370 Gets and handles the HTTP response from the remote gateway. 364 371 """ 365 self.logger.debug(' waiting for response...')372 self.logger.debug('Waiting for response...') 366 373 http_response = self.connection.getresponse() 367 self.logger.debug('got response status=%s' % http_response.status) 368 374 self.logger.debug('Got response status = %s' % http_response.status) 375 self.logger.debug('Content-Type = %s' % http_response.getheader('Content-Type')) 376 369 377 if http_response.status != HTTP_OK: 370 self.logger.debug('content-type = %s' % http_response.getheader('Content-Type')) 371 self.logger.debug('body = %s' % http_response.read()) 378 self.logger.debug('Body = %s' % http_response.read()) 372 379 373 380 if hasattr(httplib, 'responses'): … … 381 388 382 389 if content_type != remoting.CONTENT_TYPE: 383 self.logger.debug('content-type = %s' % http_response.getheader('Content-Type')) 384 self.logger.debug('body = %s' % http_response.read()) 390 self.logger.debug('Body = %s' % http_response.read()) 385 391 386 392 raise remoting.RemotingError, "Incorrect MIME type received. (got: %s)" % content_type … … 388 394 content_length = http_response.getheader('Content-Length') 389 395 bytes = '' 396 397 self.logger.debug('Content-Length = %s' % content_length) 390 398 391 399 if content_length is None: … … 394 402 bytes = http_response.read(content_length) 395 403 396 self.logger.debug(' read %d bytes for the response' % len(bytes))404 self.logger.debug('Read %d bytes for the response' % len(bytes)) 397 405 398 406 response = remoting.decode(bytes) 399 self.logger.debug(' response = %s' % response)407 self.logger.debug('Response = %s' % response) 400 408 401 409 if remoting.APPEND_TO_GATEWAY_URL in response.headers:
