| | |
| | | |
| | | private ASN1ByteChannelReader asn1Reader; |
| | | |
| | | private static int APPLICATION_BUFFER_SIZE = 4096; |
| | | |
| | | private final RedirectingByteChannel saslChannel; |
| | | private final RedirectingByteChannel tlsChannel; |
| | | private ConnectionSecurityProvider activeProvider = null; |
| | |
| | | saslChannel = |
| | | RedirectingByteChannel.getRedirectingByteChannel(tlsChannel); |
| | | this.asn1Reader = |
| | | ASN1.getReader(saslChannel, 4096, connectionHandler |
| | | ASN1.getReader(saslChannel, APPLICATION_BUFFER_SIZE, connectionHandler |
| | | .getMaxRequestSize()); |
| | | |
| | | connectionID = DirectoryServer.newConnectionAccepted(this); |
| | |
| | | * @return The socket channel that can be used to communicate with the |
| | | * client. |
| | | */ |
| | | @Override |
| | | public SocketChannel getSocketChannel() |
| | | { |
| | | return clientChannel; |
| | |
| | | writerBuffer.writer = ASN1.getWriter(saslChannel, appBufSize); |
| | | } |
| | | else |
| | | writerBuffer.writer = ASN1.getWriter(saslChannel, 4096); |
| | | writerBuffer.writer = |
| | | ASN1.getWriter(saslChannel, APPLICATION_BUFFER_SIZE); |
| | | cachedBuffers.set(writerBuffer); |
| | | } |
| | | try |
| | |
| | | |
| | | if (keepStats) |
| | | { |
| | | // TODO SASLPhase2 hard-coded for now, flush probably needs to |
| | | // TODO hard-coded for now, flush probably needs to |
| | | // return how many bytes were flushed. |
| | | statTracker.updateMessageWritten(message, 4096); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the TLS redirecting byte channel used in a LDAP client |
| | | * connection. |
| | | * |
| | | * @return The TLS redirecting byte channel. |
| | | */ |
| | | @Override |
| | | public RedirectingByteChannel getChannel() { |
| | | return this.tlsChannel; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the application buffer size used in a LDAP client connection. |
| | | * If a active security provider is being used, then the application buffer |
| | | * size of that provider is returned. |
| | | * |
| | | * @return The application buffer size. |
| | | */ |
| | | @Override |
| | | public int getAppBufferSize() { |
| | | if(activeProvider != null) |
| | | return activeProvider.getAppBufSize(); |
| | | else |
| | | return APPLICATION_BUFFER_SIZE; |
| | | } |
| | | |
| | | |
| | | |
| | | private void initializeOperationMonitors() |
| | | { |
| | | this.addMonitor = OperationMonitor.getOperationMonitor(ADD); |