void process_write_requests()

in src/afs.cc [3609:3645]


	void process_write_requests()
	{
#ifdef AFS_VERBOSE
		const char* tag = "write";
#endif
		std::lock_guard<std::mutex> lock(mutex_);
		for (auto& request : writeRequests_)
		{
			auto session = static_cast<SharedSessionData*>(
				dshash_find(sessions_, &(request->localSession->id), false));
			if (!session)
			{
				request->finished = true;
				request->localSession->errorMessage =
					std::string("stolen session: ") +
					std::to_string(request->localSession->id);
				continue;
			}
			{
				SharedSessionReleaser sessionReleaser(sessions_, session);
				if (!DsaPointerIsValid(session->errorMessage))
				{
					ProcessorLockGuard lock(this);
					request->writtenBytes =
						request->buffer->write(request->data, request->n);
				}
				request->finished = true;
			}
			P("%s: %s: %s: kill executor: %d",
			  Tag,
			  tag_,
			  tag,
			  request->localSession->peerPID);
			kill(request->localSession->peerPID, SIGUSR1);
		}
		writeRequests_.clear();
	}