Tufão 1.0.0

After a long time developing Tufão, it finally reached 1.0 version some hours ago. I’ve spent a lot of time cleaning up the API and exploring the features provided by C++11 and Qt5 to release this version.

This is the first Tufão release that:

  • … breaks config files, so you’ll need to update your config files to use them with the new version
  • … breaks ABI, so you’ll need to recompile your projects to use the new version
  • … breaks API, so you’ll need to change your source code to be able to recompile your previous code and use the new version
  • … breaks previous documented behaviour, so you’ll need to change the way you use features that were available before. But don’t worry, because the list of these changes are really small and are well documented below.

Porting to Tufão 1.0

From now on, you should link against tufao1 instead of tufao. The PKGCONFIG, qmake and CMake files were renamed also, so you can have different Tufão libraries in the same system if their major version differs.

The list of behavioural changes are:

  • Headers are being stored using a Hash-table, so you can’t easily predict (and shouldn’t) the order of the headers anymore. I hope this change will improve the performance.
  • HttpServerRequest::ready signal auto-disconnects all slots connected to the HttpServerRequest::data and HttpServerRequest::end slots before being emitted.
  • HttpFileServer can automatically detect the mime type from the served files, so if you had your own code logic to handle the mimes, you should throw it away and enjoy a lesser code base to maintain.

Most of the errors related to API changes are caught at compile-time and you can use the Qt5’s new connection syntax and C++11’s override keyword to catch the remaining errors.


The list of changes:

  • The project finally have a logo (made by me in Inkscape)
  • Deprecated API was removed
  • Url and QueryString removed in favor of QUrl
  • Headers refactored to inherit from QMultiHash instead of QMultiMap
  • HttpServerResponse
    • Constructor’s options argument is optional now
    • setOptions method added
    • Constructor takes a reference to a QIODevice instead a pointer
  • HttpServerRequest
    • Constructor takes a reference to a QAbstractSocket instead a pointer
    • socket method returns a reference instead a pointer
    • url returns a QUrl
    • data signal was changed and you must use readBody method to access body’s content
    • the upgrade’s head data is accessed from the request body from now on
    • now the object auto-disconnects slots from data and end signals right before emit ready
    • setCustomData and customData methods added
      • Now HttpServerRequestRouter use these methods to pass the list of captured texts
  • HttpServer uses reference instead of pointers in several places
  • AbstractHttpServerRequestRouter refactored to explore lambdas features
  • Tufão’s plugin system fully refactored
    • It’s using JSON files as configuration
  • AbstractHttpServerRequestHandler::handleRequest
    • It uses references instead pointers
    • It receives 2 arguments instead of 3
  • One more abstraction to sessions created to explore lambdas
  • WebSocket
    • startServerHandshake is taking references instead pointers
    • This change exposes a model more predictive and natural
    • I’m caring less about Qt style and more about C++ style
      • But don’t worry, I’ll maintain a balance
  • Using scoped enums
  • HttpFileServer uses/sends mime info
  • Interfaces don’t inherit from QObject anymore, so you can use multiple inheritance to make the same class implement many interfaces
  • HttpUpgradeRouter introduced
    • HttpServer::setUpgradeHandler also
  • Updated QtCreator plugin to work with QtCreator 2.7.0 and Qt 5

The future

I want to improve the Tufão’s stability and performance, so now I’ll focus on a minor relase with unit testing and some minor changes.

After Tufão 1.0.1, I’ll focus on BlowThemAll.


You can see a visualization video based on the history of commits below.

This release deserves a wallpaper, so I made one. See it below:

Tufão wallpaper

You can download the source of the previous wallpaper here.

What are you still doing here? Go download the new version right now!


Tags:, , ,

5 responses to “Tufão 1.0.0”

  1. Adrián Chaves Fernández says :

    I had recently read this blog post, but I had forgotten the name of the framework. So, today, when I had the idea of creating a web application (in the future) and I decided to go on and use this framework, I had to search for it.

    When I searched for “qt web framework”, in addition to Tufão, I found out about QDjango: http://code.google.com/p/qdjango/

    I would like to suggest that you have a look at this project and talk to their developers, and hopefully one of the following things happen:
    * You both teams realize that you have exactly the same goals, and agree on enough things as to merge the projects together.
    * You both teams realize that, while you have similar goals, there are differences that justify the existence of both projects.

    In the latter case, whatever the reasons be that justify the existence of both projects (even if they are as “studid” as not agreeing on a name for the joint project), I would love to see that you both mention each other project in your documentation, explaining the differences, and maybe why someone would want to use a project and not the other.

    I will suggest the same to the QDjango developers as well.

    I really hope you take my advice. Currently, searching for “qdjango tufao” in Google throws absolutely no results, and for the time I choose one framework or the other for my application (assuming the projects were not merged) , I would like to take an informed decision, and not to throw a coin. From the description of each project, you seem to take similar approaches and have the quite similar goals.

  2. Jose says :

    I download the package from github and try to build the project to Visual Studio 2010 and Qt 5 with cmake 2.8.11 but I got the following error:

    Try C++11 flag = [-std=c++11]
    Performing Test CXX11_FLAG_DETECTED
    Performing Test CXX11_FLAG_DETECTED – Failed
    Try C++11 flag = [-std=c++0x]
    Performing Test CXX11_FLAG_DETECTED
    Performing Test CXX11_FLAG_DETECTED – Failed
    Try C++11 flag = [ ]
    Performing Test CXX11_FLAG_DETECTED
    Performing Test CXX11_FLAG_DETECTED – Failed
    Try C++11 flag = [/Qstd=c++0x]
    Performing Test CXX11_FLAG_DETECTED
    Performing Test CXX11_FLAG_DETECTED – Failed
    CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
    Could NOT find CXX11 (missing: CXX11_FLAGS)
    Call Stack (most recent call first):
    C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
    cmake/modules/FindCXX11.cmake:61 (find_package_handle_standard_args)
    CMakeLists.txt:16 (find_package)

    can help me?

    • Vinipsmaker says :

      Tufão 1.0 depends on features of C++11 and may not be compatible with Visual Studio.

      You can:

      * Use Tufão 0.x with Qt 4
      * Use the latest Tufão 0.x with Qt 5 (the support is experimental and may be workable in the very next version, very soon)
      * Use Tufão 1.x with MingW or other compilers

      You see, Tufão 1.x was a bet for the future, but Tufão 0.x is still being developed. The future is C++11, but unfortunately the Microsoft compilers aren’t following the competitors and I started to add support for Qt5 in Tufão 0.x.

Comentários (with MarkDown support)

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair /  Alterar )

Foto do Google+

Você está comentando utilizando sua conta Google+. Sair /  Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair /  Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair /  Alterar )


Conectando a %s

%d blogueiros gostam disto: