Example #1
0
void IDBTransaction::deleteObjectStoreOnServer(TransactionOperation& operation, const String& objectStoreName)
{
    LOG(IndexedDB, "IDBTransaction::deleteObjectStoreOnServer");
    ASSERT(isVersionChange());

    serverConnection().deleteObjectStore(operation, objectStoreName);
}
Example #2
0
void IDBTransaction::deleteIndexOnServer(TransactionOperation& operation, const uint64_t& objectStoreIdentifier, const String& indexName)
{
    LOG(IndexedDB, "IDBTransaction::deleteIndexOnServer");
    ASSERT(isVersionChange());

    serverConnection().deleteIndex(operation, objectStoreIdentifier, indexName);
}
Example #3
0
TSock::TSock(QTcpSocket *sock, QObject *parent) :
  QObject(parent),
  listenPort(0)
{

    if (sock == NULL)
        socket = new QTcpSocket;
    else
        socket = sock;

    connect(socket, SIGNAL(connected()),
            this, SLOT(socketConnected()));

    connect(socket, SIGNAL(disconnected()),
            this, SLOT(socketDisconnected()));

    connect(socket, SIGNAL(error(QAbstractSocket::SocketError)),
            this, SLOT(socketError(QAbstractSocket::SocketError)));

    connect(socket, SIGNAL(readyRead()),
            this, SLOT(socketDataReady()));


    connect(&server, SIGNAL(newConnection()),
            this, SLOT(serverConnection()));
}
Example #4
0
/* 
 * sends the request then it gets data from the outside server then sends to outside client
 */
void* doit(void * data){
  struct treadInfo *thread=(struct doitInfo *)data;
  int   portValue=0;
  int  *port=&portValue;

  //ignore SIGPIPE singal
  signal(SIGPIPE, SIG_IGN);

  //builds the request from client
  struct requestInfo getRequest=request(thread,port);
  
  //connecting to server  if fails closes //need to change to own function
  (*thread).serverfd=serverConnection((char *)getRequest.hostname,*getRequest.port,thread);
  
  //prints out the request will add to request function
  printf("Thread %d: Forwarding request to end server:\n",(*thread).ID);
  printf("%s",(char *)getRequest.request);
  printf("*** End of Request ***\n\n");
  
  //set Rio
  rio_readinitb(&(*thread).rioWithServer,(*thread).serverfd);

  //send request
  rio_writen_w((*thread).serverfd,getRequest.request,strlen((const char *)getRequest.request),thread);

  //transfer recieved data from server to client
  transferData(thread);
  
  //should never reach this exit()
  exit(0);
}
Example #5
0
void IDBTransaction::putOrAddOnServer(TransactionOperation& operation, RefPtr<IDBKey> key, RefPtr<SerializedScriptValue> value, const IndexedDB::ObjectStoreOverwriteMode& overwriteMode)
{
    LOG(IndexedDB, "IDBTransaction::putOrAddOnServer");

    ASSERT(!isReadOnly());

    serverConnection().putOrAdd(operation, key, value, overwriteMode);
}
Example #6
0
void IDBTransaction::commitOnServer(TransactionOperation& operation)
{
    LOG(IndexedDB, "IDBTransaction::commitOnServer");
    serverConnection().commitTransaction(*this);

    ASSERT(m_transactionOperationMap.contains(operation.identifier()));
    m_transactionOperationMap.remove(operation.identifier());
}
/**
 * Starts a local socket server
 */
void InstanceManager::startServer()
{
  mServer = new QLocalServer(this);

  if (mServer->listen(mKey)) {
    mReadyReadMapper = new QSignalMapper(this);
    connect(mReadyReadMapper, SIGNAL(mapped(QObject*)),
            this, SLOT(serverReadyRead(QObject*)));
    connect(mServer, SIGNAL(newConnection()), this, SLOT(serverConnection()));
  } else {
bool IDBDatabase::dispatchEvent(Event& event)
{
    LOG(IndexedDB, "IDBDatabase::dispatchEvent (%" PRIu64 ")", m_databaseConnectionIdentifier);

    bool result = WebCore::IDBDatabase::dispatchEvent(event);

    if (event.isVersionChangeEvent() && event.type() == eventNames().versionchangeEvent)
        serverConnection().didFireVersionChangeEvent(m_databaseConnectionIdentifier, downcast<IDBVersionChangeEvent>(event).requestIdentifier());

    return result;
}
void IDBDatabase::fireVersionChangeEvent(const IDBResourceIdentifier& requestIdentifier, uint64_t requestedVersion)
{
    uint64_t currentVersion = m_info.version();
    LOG(IndexedDB, "IDBDatabase::fireVersionChangeEvent - current version %" PRIu64 ", requested version %" PRIu64 ", connection %" PRIu64, currentVersion, requestedVersion, m_databaseConnectionIdentifier);

    if (!scriptExecutionContext() || m_closePending) {
        serverConnection().didFireVersionChangeEvent(m_databaseConnectionIdentifier, requestIdentifier);
        return;
    }

    Ref<Event> event = IDBVersionChangeEvent::create(requestIdentifier, currentVersion, requestedVersion, eventNames().versionchangeEvent);
    event->setTarget(this);
    scriptExecutionContext()->eventQueue().enqueueEvent(WTFMove(event));
}
void IDBTransaction::abortOnServerAndCancelRequests(TransactionOperation&)
{
    LOG(IndexedDB, "IDBTransaction::abortOnServerAndCancelRequests");

    ASSERT(m_transactionOperationQueue.isEmpty());

    serverConnection().abortTransaction(*this);

    IDBError error(IDBDatabaseException::AbortError);
    for (auto& operation : m_abortQueue)
        operation->completed(IDBResultData::error(operation->identifier(), error));

    // Since we're aborting, it should be impossible to have queued any further operations.
    ASSERT(m_transactionOperationQueue.isEmpty());
}
Example #11
0
void IDBTransaction::establishOnServer()
{
    LOG(IndexedDB, "IDBTransaction::establishOnServer");

    serverConnection().establishTransaction(*this);
}
Example #12
0
void IDBTransaction::clearObjectStoreOnServer(TransactionOperation& operation, const uint64_t& objectStoreIdentifier)
{
    LOG(IndexedDB, "IDBTransaction::clearObjectStoreOnServer");

    serverConnection().clearObjectStore(operation, objectStoreIdentifier);
}
Example #13
0
void IDBTransaction::deleteRecordOnServer(TransactionOperation& operation, const IDBKeyRangeData& keyRange)
{
    LOG(IndexedDB, "IDBTransaction::deleteRecordOnServer");

    serverConnection().deleteRecord(operation, keyRange);
}
Example #14
0
void IDBTransaction::getCountOnServer(TransactionOperation& operation, const IDBKeyRangeData& keyRange)
{
    LOG(IndexedDB, "IDBTransaction::getCountOnServer");

    serverConnection().getCount(operation, keyRange);
}
Example #15
0
void IDBTransaction::iterateCursorOnServer(TransactionOperation& operation, const IDBKeyData& key, const unsigned long& count)
{
    LOG(IndexedDB, "IDBTransaction::iterateCursorOnServer");

    serverConnection().iterateCursor(operation, key, count);
}
void IDBTransaction::commitOnServer(TransactionOperation&)
{
    LOG(IndexedDB, "IDBTransaction::commitOnServer");
    serverConnection().commitTransaction(*this);
}